// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'DropSource.pas' rev: 5.00

#ifndef DropSourceHPP
#define DropSourceHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Commctrl.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <ActiveX.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------
typedef System::DelphiInterface<IEnumFORMATETC> _di_IEnumFORMATETC;

namespace Dropsource
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TInterfacedComponent;
class PASCALIMPLEMENTATION TInterfacedComponent : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	int fRefCount;
	
protected:
	HIDESBASE HRESULT __stdcall QueryInterface(const GUID &IID, /* out */ void *Obj);
	HIDESBASE int __stdcall _AddRef(void);
	HIDESBASE int __stdcall _Release(void);
public:
	#pragma option push -w-inl
	/* TComponent.Create */ inline __fastcall virtual TInterfacedComponent(Classes::TComponent* AOwner)
		 : Classes::TComponent(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TInterfacedComponent(void) { }
	#pragma option pop
	
private:
	void *__IUnknown;	/* IUnknown */
	
public:
	operator IUnknown*(void) { return (IUnknown*)&__IUnknown; }
	
};


#pragma option push -b-
enum TDragType { dtCopy, dtMove, dtLink };
#pragma option pop

typedef Set<TDragType, dtCopy, dtLink>  TDragTypes;

#pragma option push -b-
enum TDragResult { drDropCopy, drDropMove, drDropLink, drCancel, drOutMemory, drUnknown };
#pragma option pop

typedef void __fastcall (__closure *TDropEvent)(System::TObject* Sender, TDragType DragType, bool &ContinueDrop
	);

typedef void __fastcall (__closure *TFeedbackEvent)(System::TObject* Sender, int Effect, bool &UseDefaultCursors
	);

class DELPHICLASS TDropSource;
class PASCALIMPLEMENTATION TDropSource : public TInterfacedComponent 
{
	typedef TInterfacedComponent inherited;
	
private:
	TDragTypes fDragTypes;
	TDropEvent fDropEvent;
	TFeedbackEvent fFBEvent;
	tagFORMATETC fDataFormats[20];
	int fDataFormatsCount;
	Controls::TImageList* fImages;
	bool fShowImage;
	int fImageIndex;
	Windows::TPoint fImageHotSpot;
	void __fastcall SetShowImage(bool Value);
	
protected:
	int FeedbackEffect;
	HRESULT __stdcall QueryContinueDrag(BOOL fEscapePressed, int grfKeyState);
	HRESULT __stdcall GiveFeedback(int dwEffect);
	HRESULT __stdcall GetData(const tagFORMATETC &FormatEtcIn, /* out */ tagSTGMEDIUM &Medium);
	HRESULT __stdcall GetDataHere(const tagFORMATETC &FormatEtc, /* out */ tagSTGMEDIUM &Medium);
	HRESULT __stdcall QueryGetData(const tagFORMATETC &FormatEtc);
	HRESULT __stdcall GetCanonicalFormatEtc(const tagFORMATETC &FormatEtc, /* out */ tagFORMATETC &FormatEtcout
		);
	HRESULT __stdcall SetData(const tagFORMATETC &FormatEtc, tagSTGMEDIUM &Medium, BOOL fRelease);
	HRESULT __stdcall EnumFormatEtc(int dwDirection, /* out */ _di_IEnumFORMATETC &EnumFormatEtc);
	HRESULT __stdcall dAdvise(const tagFORMATETC &FormatEtc, int advf, const _di_IAdviseSink advsink, /* out */ 
		int &dwConnection);
	HRESULT __stdcall dUnadvise(int dwConnection);
	HRESULT __stdcall EnumdAdvise(/* out */ _di_IEnumSTATDATA &EnumAdvise);
	virtual HRESULT __fastcall DoGetData(const tagFORMATETC &FormatEtcIn, /* out */ tagSTGMEDIUM &Medium
		) = 0 ;
	virtual void __fastcall AddFormatEtc(Word cfFmt, Activex::PDVTargetDevice pt, int dwAsp, int lInd, 
		int tym);
	bool __fastcall InternalCutCopyToClipboard(int Effect);
	virtual bool __fastcall CutOrCopyToClipboard(void);
	void __fastcall SetImages(const Controls::TImageList* Value);
	void __fastcall SetImageIndex(const int Value);
	void __fastcall SetPoint(int Index, int Value);
	int __fastcall GetPoint(int Index);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
		);
	
public:
	__fastcall virtual TDropSource(Classes::TComponent* aowner);
	TDragResult __fastcall Execute(void);
	virtual bool __fastcall CutToClipboard(void);
	virtual bool __fastcall CopyToClipboard(void);
	
__published:
	__property TDragTypes Dragtypes = {read=fDragTypes, write=fDragTypes, nodefault};
	__property TFeedbackEvent OnFeedback = {read=fFBEvent, write=fFBEvent};
	__property TDropEvent OnDrop = {read=fDropEvent, write=fDropEvent};
	__property Controls::TImageList* Images = {read=fImages, write=SetImages};
	__property int ImageIndex = {read=fImageIndex, write=SetImageIndex, nodefault};
	__property bool ShowImage = {read=fShowImage, write=SetShowImage, nodefault};
	__property int ImageHotSpotX = {read=GetPoint, write=SetPoint, index=1, nodefault};
	__property int ImageHotSpotY = {read=GetPoint, write=SetPoint, index=2, nodefault};
public:
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TDropSource(void) { }
	#pragma option pop
	
private:
	void *__IDropSource;	/* IDropSource */
	void *__IDataObject;	/* IDataObject */
	
public:
	operator IDataObject*(void) { return (IDataObject*)&__IDataObject; }
	operator IDropSource*(void) { return (IDropSource*)&__IDropSource; }
	
};


class DELPHICLASS TDropTextSource;
class PASCALIMPLEMENTATION TDropTextSource : public TDropSource 
{
	typedef TDropSource inherited;
	
private:
	AnsiString fText;
	
protected:
	virtual HRESULT __fastcall DoGetData(const tagFORMATETC &FormatEtcIn, /* out */ tagSTGMEDIUM &Medium
		);
	virtual bool __fastcall CutOrCopyToClipboard(void);
	
public:
	__fastcall virtual TDropTextSource(Classes::TComponent* aOwner);
	
__published:
	__property AnsiString Text = {read=fText, write=fText};
public:
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TDropTextSource(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint MAXFORMATS = 0x14;
extern PACKAGE unsigned CF_FILEGROUPDESCRIPTOR;
extern PACKAGE unsigned CF_FILECONTENTS;
extern PACKAGE unsigned CF_FILENAMEMAP;
extern PACKAGE unsigned CF_FILENAMEMAPW;
extern PACKAGE unsigned CF_IDLIST;
extern PACKAGE unsigned CF_PREFERREDDROPEFFECT;
extern PACKAGE unsigned CF_URL;
extern PACKAGE _di_IMalloc ShellMalloc;
extern PACKAGE void __fastcall Register(void);

}	/* namespace Dropsource */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Dropsource;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// DropSource
